<?php

class paymentsController {
	
	function __construct() {
	}
	
	public function render( $tplname, $data = null ) {
		$block = App::me()->viewPath. DIRECTORY_SEPARATOR .'payments'. DIRECTORY_SEPARATOR .$tplname;
		$tpl = App::me()->tpl;
		$tpl->assign('data', $data);
		$tpl->display($block.'.tpl');
	}
	
	public function index() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->listcat();
		$this->render('form', $data);		
	}	

// jtp
	public function listjtp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->listjtp();
		echo json_encode( $data );
	}
	
	public function findjtp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->findjtp();
		echo json_encode( $data );
	}
	
	public function insjtp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->insjtp();
		echo json_encode( $data );
	}
	
	public function updjtp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->updjtp();
		echo json_encode( $data );
	}
	
	public function deljtp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->deljtp();
		echo json_encode( $data );
	}
	
// btp
	public function listbtp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->listbtp();
		echo json_encode( $data );
	}
	
	public function findbtp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->findbtp();
		echo json_encode( $data );
	}
	
	public function insbtp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->insbtp();
		echo json_encode( $data );
	}
	
	public function updbtp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->updbtp();
		echo json_encode( $data );
	}
	
	public function delbtp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->delbtp();
		echo json_encode( $data );
	}
	
// itp
	public function listitp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->listitp();
		echo json_encode( $data );
	}
	
	public function finditp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->finditp();
		echo json_encode( $data );
	}
	
	public function findallitp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->findallitp();
		echo json_encode( $data );
	}
	
	public function insitp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->insitp();
		echo json_encode( $data );
	}
	
	public function upditp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->upditp();
		echo json_encode( $data );
	}
	
	public function delitp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->delitp();
		echo json_encode( $data );
	}
	
// otp
	public function listotp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->listotp();
		echo json_encode( $data );
	}
	
	public function findotp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->findotp();
		echo json_encode( $data );
	}
	
	public function findallotp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->findallotp();
		echo json_encode( $data );
	}
	
	public function insotp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->insotp();
		echo json_encode( $data );
	}
	
	public function updotp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->updotp();
		echo json_encode( $data );
	}
	
	public function delotp() {		
		if( !Tools::isAjax() ) return;
		session_start();
		$model = new payments;
		$data = $model->delotp();
		echo json_encode( $data );
	}
	
	public function jsload() {		
		if( !Tools::isAjax() ) return;
		App::me()->js_load('payments.js');
	}	
	
}
?>